'use strict'
import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

/**
 * 列表查询
 */
export function queryPage(data, url) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: url,
    method: 'post',
    data
  })
}

/**
 * 查询回复
 */
export function query(data, url) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: url,
    method: 'post',
    data
  })
}

/**
 * 获取推荐最大排序号
 */
export function getMaxSort(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/excellentConsultLog/getMaxSort',
    method: 'post',
    data
  })
}
/**
 * 修改排序号
 */
export function isCopy(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/excellentConsultLog/copyIdExists',
    method: 'post',
    data
  })
}
/**
 * 修改排序号
 */
export function updateSort(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/excellentConsultLog/update',
    method: 'post',
    data
  })
}

/**
 * 查询单条回复
 */
export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/consultativeLog/getDetil',
    method: 'post',
    data
  })
}

/**
 * 编辑
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/consultativeLog/update',
    method: 'post',
    data
  })
}

/**
 * 回复
 */
export function replay(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/consultativeLog/insert',
    method: 'post',
    data
  })
}

/**
 * 发布/取消发布
 */
export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/excellentConsultLog/updateStatus',
    method: 'post',
    data
  })
}

/**
 * 删除精选
 */
export function del(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/excellentConsultLog/deleteByIds',
    method: 'post',
    data
  })
}
/**
 * 删除的某个回复
 */
export function delItem(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/excellentConsultLog/deleteById',
    method: 'post',
    data
  })
}
/**
 * 新增精选
 */
export function insertItem(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/excellentConsultLog/insert',
    method: 'post',
    data
  })
}
